describe("MoveWhenController unit test", function(){

    var moveWhenController = null;

    beforeEach(function(){


        var t_alertCtrl = App.AlertController.create();
        var t_loadingCtrl = App.LoadingController.create();
        var t_moveHolderCtrl = App.MoveHolderController.create();
        App.MoveWhenController.reopen({

            init:function(){
                this.set('controllers.alert', t_alertCtrl);
                this.set('controllers.loading', t_loadingCtrl);
                this.set('controllers.moveHolder', t_moveHolderCtrl);
            }
        });

        moveWhenController = App.MoveWhenController.create();
    });
    describe("controller unit test", function(){

        beforeEach(function(){
            var transfer = App.OwnAccountTransfer.create();
            transfer.isPostDateAllowed = false;
            spyOn(App.getSession(),'getCurrentTransfer').andReturn(transfer);
        });

        it("continueAction", function(){
            spyOn(moveWhenController, 'transitionTo');
            moveWhenController.continueAction();
            expect(moveWhenController.transitionTo).toHaveBeenCalledWith('move.confirm');

            var transfer = App.getSession().getCurrentTransfer();
            transfer.isTransactionPasswordRequired = true;
            moveWhenController.continueAction();
            expect(moveWhenController.transitionTo).toHaveBeenCalledWith('move.transactionPwd');
        });
    });
})